import { defineComponent, onMounted, ref } from "vue";
import style from "./index.module.less";
import { IAMap } from "./types";
export default defineComponent({
  name: "",
  setup(_, { expose }) {
    let map = ref<IAMap>();
    let mapRef = ref();
    onMounted(() => {
      map.value = new AMap.Map(mapRef.value, {
        resizeEnable: true,
        center: [116.473188, 39.993253],
        zoom: 13,
      });
    });

    expose({
      map: () => map.value,
    });
    return () => {
      return <div ref={mapRef} class="w-full h-full" />;
    };
  },
});
